<link href="../addons/jy_cun9fan/custom/templates/mobile/style.css?v=201705251730" rel="stylesheet">
<style>
.fui-header a.back:before {
    border-color: #fff;
}
.fui-header:after {
	height: 0;
	border-bottom: 0 solid #D9D9D9;
}
</style>
<div class="fui-page fui-page-current page-commission-down">
	 <div class="fui-header sysbgcolor">
        <div class="fui-header-left">
            <a class="back" style="color:#fff" ng-click="goback();"></a>
        </div>
        <div class="title" style="color:#fff">我的回补</div>
    </div>
    <div class="fui-content">
		<div style="background: {{main.syscolor||'#05c175'}};margin-top:0;height:5rem">
		</div>
		<div style="padding:0.5rem;margin-top:-4.5rem">
		<div class="radius" style="background:#fff;position: relative;">
				<div class="fui-cell-title c" style="font-size:0.7rem;padding-left:0.5rem;padding-top:1rem;padding-bottom:0">
					<div class="bold">剩余回补</div>
					<div style="font-size:1.5rem">{{pagedata.member.lastfanfee||'0.00'}}</div>
				</div>
				<div class="fui-cell-title c" style="font-size:0.7rem;padding-left:0.5rem;padding-top:0">
					<div class="bold">未激活回补</div>
					<div style="font-size:1.5rem">{{pagedata.member.lastjiafee||'0.00'}}</div>
				</div>
				<i class="icon icon-dixiaofei syscolor" style="font-size:2.6rem;position: absolute;top:0;right:0.5rem" href="javascript:;" ng-click="access_json('jy_cun9fan/orderfee//type=6')"></i>
		</div>
        <div class="fui-cell-group radius" ng-repeat="item in pagedata.list" style="background:{{item.bgcolor||'#f60'}};">
			<div class="fui-cell">
				<div class="fui-cell-text" style="line-height:2">
					<div class="gray" style="color:#eee;font-size:0.6rem">总回补数：{{item.fanfee}}</div>
					<div class="gray" style="color:#eee;font-size:0.6rem">已回补：{{item.isfee}}</div>
					<div class="gray" style="color:#eee;font-size:0.6rem">剩余回补：{{item.lastfanfee}}</div>
				</div>
				<div class="fui-cell-remark noremark">
					<div class="bold" style="color:#fff;font-size:0.9rem">{{item.statustitle}}</div>
					<div class="gray" style="color:#eee;font-size:0.6rem">激活时间：{{item.createtime}}</div>
					<div class="label label-success-o" ng-click="pagedata.toplog(item.orderid);">查看明细 >></div>
				</div>
			</div>
			<div class="water">
					<div class="water-1"></div>
					<div class="water-2"></div>
			</div>
		</div>
		<div class='infinite-loading' style="display:none" id="loading_show"><span class='fui-preloader'></span><span class='text'> 正在加载...</span></div>
		<div ng-if="pagedata.list.length==0" class='content-empty' >
			<i class="icon jinyunicon icon-cry" style="width: 6rem;margin-bottom: 0.5rem;"></i>
			<br/>
			<p style="color: #999;font-size: .75rem">暂时没有任何数据</p>
		</div>
		</div>
		<div ng-include="sys_html('common/_copyright',true)"></div>
    </div>
</div>
<div ng-if="pagedata.showlog" class="popup">
	<div class="popup-body">
		<div class="popup-center" style="padding:0.5rem 0;">
			<i class="closed icon icon-cuowu" ng-click="pagedata.showlog=false"></i>
			<div class="fui-list-group" style="background:#fff;max-height:22rem;overflow-y:scroll">
				<div ng-repeat="item in pagedata.loglist" class="fui-list" style="height: auto">
					<div class="fui-list-inner">
						<div class="row">
							 <div class="row-text"  style="font-size:0.65rem;"> 
							订单号 {{item.ordersn}}
							  </div>
						</div>
						<div class="subtitle" style="font-size: .55rem;">
							时间：{{item.createtime}}
						</div>
					</div>
					<div  class="row-remark" style="font-size:0.65rem;width:4rem">
						<p>额度:{{item.money}}</p>
						<div class="label label-success sysbgcolor">{{item.typetitle}}</div>
					</div>
				</div>
			</div>
			<div ng-if="pagedata.loglist.length==0" class='content-empty' style="margin-top: 0.5rem;">
				<i class="icon jinyunicon icon-cry" style="width: 6rem;margin-bottom: 0.5rem;"></i>
				<br/>
				<p style="color: #999;font-size: .75rem">暂时没有任何数据</p>
			</div>
		</div>
	</div>
</div>
<div ng-include="sys_html('_footer')"></div>
<script>
scope.pagedata.get_list=function(){
	scope.tool.get_list('jy_cun9fan/fanlog/list/',true);
}
scope.tool.get_list('jy_cun9fan/fanlog/list/',true);
scope.pagedata.get_loglist=function(isfirst){
		var url='jy_cun9fan/orderfee/list/'
		if(!scope.pagedata.params){
			scope.pagedata.params={};
		}
		if(isfirst){
			scope.pagedata.params.page=1;
			scope.pagedata.loglist=[];
			scope.pagedata.loaded=false;
		}else if(scope.pagedata.loaded || scope.pagedata.loading){
			return;
		}
		scope.pagedata.loading=true;
		$('#loading_show').show();
		var query=scope.made_query(scope.pagedata.params);
		if(query){
			url+='&'+query;
		}
		console.log('url');console.log(url);
		scope.get(url,function(res){
			//console.log(res);
			scope.pagedata.loading=false;
			$('#loading_show').hide();
			if(!scope.pagedata.loglist || isfirst){
				scope.pagedata.loglist=[];
			}
			if(res=='none'){
				scope.pagedata.loaded=true;
				return;
			}
			if(!Array.isArray(res)){
				var loglist=res.loglist?res.loglist:[]
			}else{
				var loglist=res
			}
			if(loglist.length==0 || (scope.pagedata.psize && loglist.length<scope.pagedata.psize)){
				scope.pagedata.loaded=true;
			}
			if(loglist && loglist != 'null' && loglist != 'undefined'){
				for(let key in loglist){
					scope.pagedata.loglist.push(loglist[key]);
				}
			}
			if(scope.pagedata.params){
				scope.pagedata.params.page++;
			}
		});
}
scope.pagedata.scroll_bottom=function(){
	if(scope.pagedata.showlog){
		scope.pagedata.get_loglist();
	}else{
		scope.tool.get_list('jy_cun9fan/fanlog/list/');
	}
}
scope.pagedata.toplog=function(orderid){
	scope.pagedata.showlog=true;
	scope.pagedata.params.ordersn=orderid;
	scope.pagedata.params.type=6;
	scope.pagedata.get_loglist(true);
	scope.$evalAsync();
}
</script>

